﻿namespace Repositories.DM;

/// <summary>
/// 用户
/// </summary>
[SugarTable("s_user")]
public class User
{
    /// <summary>
    /// 主键
    /// </summary>
    [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
    public int Id { get; set; }

    /// <summary>
    /// 统一认证用户id
    /// </summary>
    [SugarColumn(ColumnName = "userid")]
    public int UserId { get; set; }

    /// <summary>
    /// 用户名
    /// </summary>
    [SugarColumn(ColumnName = "account")]
    public string Account { get; set; }

    /// <summary>
    /// 姓名
    /// </summary>
    [SugarColumn(ColumnName = "name")]
    public string Name { get; set; }

    /// <summary>
    /// 用户类型（0-其他 1-教职工 2-学生）
    /// </summary>
    [SugarColumn(ColumnName = "type")]
    public int Type { get; set; }

    /// <summary>
    /// 部门/班级编号
    /// </summary>
    [SugarColumn(ColumnName = "orgcode")]
    public string? OrgCode { get; set; }

    /// <summary>
    /// 部门/班级名称
    /// </summary>
    [SugarColumn(ColumnName = "orgname")]
    public string? OrgName { get; set; }

    /// <summary>
    /// 角色id
    /// </summary>
    [SugarColumn(ColumnName = "roleid")]
    public int RoleId { get; set; }

    /// <summary>
    /// 角色集合
    /// </summary>
    [SugarColumn(ColumnName = "roles", IsJson = true)]
    public List<int> Roles { get; set; }

    /// <summary>
    /// 0 未知 1 男 2 女
    /// </summary>
    [SugarColumn(ColumnName = "gender")]
    public int Gender { get; set; }

    /// <summary>
    /// 头像
    /// </summary>
    [SugarColumn(ColumnName = "avatar")]
    public string? Avatar { get; set; }

    /// <summary>
    /// 是否启用（1：启用，2：禁用）
    /// </summary>
    [SugarColumn(ColumnName = "enable")]
    public int Enable { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(ColumnName = "createtime")]
    public DateTime CreateTime { get; set; }
}
